#include <stdio.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <unistd.h>
#include <string.h>

int main()
{
        close(1);
        int fd = open("log.txt", O_WRONLY | O_CREAT | O_TRUNC, 0666);
        if (fd < 0)
        {
              perror("open");
              return 1;
        }


        printf("fd:%d\n",fd);
        printf("hello Yuzuriha\n");
        printf("hello Yuzuriha\n");
        printf("hello Yuzuriha\n");

        const char* msg="你好\n";
        write(fd,msg,strlen(msg));
        close(fd);
}
